home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / COM / ProTERM Mac1.2a.sit / ProTERM Mac1.2a / Macros / Startup Macro < prev    next >
Text File  |  1996-07-24  |  2KB  |  69 lines

  1. /*************************************
  2.  *                                   *
  3.  * Main Startup Macro                *
  4.  *                                   *
  5.  * Loads Resident Macros and         *
  6.  * Execs User Startup Macros         *
  7.  *                                   *
  8.  * Version 1201,  7/6/96             *
  9.  *                                   *
  10.  *************************************/
  11.  
  12. /*
  13. This file is periodically updated by InTrec Software. As such, modifications to this file are not advised (because it becomes very difficult to move your changes to new versions of this file). Instead, make your changes to the Resident User # or Startup User # (where # is a number) file instead. That way, even if you get an updated version of Resident Macros, your own personal macros remain unchanged within the Resident User # file. Note that these directions supercede those given in the Macros chapter of the manual which advises changing the Resident Macros file directly.
  14.  
  15. The Resident User # files have precedence over the Resident Macros file. Therefore, if you define duplicate routines or variables in the Resident User # files, they will be used instead of those in the Resident Macros file.
  16. */
  17.  
  18. FUNC main()
  19. {
  20.  IF (!ARGC()) {
  21.   LOADER("Startup *",ARGC());
  22.  }
  23.  
  24.  LOADER("Resident *",ARGC());
  25.  
  26.  IF (ARGC()) {
  27.   WIN_NOTE(1,"Resident macros reloaded.");
  28.  }
  29.  
  30.  RETURN;
  31. }
  32.  
  33. // launch macros
  34. FUNC loader(STR name, INT reload)
  35. {
  36.  INT fcur,fmax,fwid;
  37.  STR files,fname;
  38.  SHARED STR _mac1;
  39.  
  40.  WIN_RUNNING(0);
  41.  TIME_EXEC(200);
  42.  files = FN_SCAN(FN_WHERE(PREF_GET("mac1")),"","TEXTDIRC",name);
  43.  IF (files == "") {
  44.   WIN_NOTE(1,"Error Loading Macros");
  45.   RETURN;
  46.  }
  47.  fmax = NUM_LONG(STR_MID(files,0,4));
  48.  fwid = NUM_LONG(STR_MID(files,4,4));
  49.  
  50.  fcur = 1;
  51.  WHILE (fcur <= fmax) {
  52.   TIME_EXEC(200);
  53.   fname = STR_MID(files,8+fcur*fwid,fwid);
  54.   fname = STR_MID(fname,1,NUM_BYTE(fname));
  55.   fname = FN_PACK(FN_RESOLVE("",fname));
  56.   RESIDENT(fname,0,-1);
  57.   RESIDENT(fname,0,-1);
  58.   EXTERN(fname,STARTUP(fname,reload));
  59.   fcur = fcur + 1;
  60.  }
  61.  RETURN;
  62. }
  63.  
  64. // just in case this gets called
  65. FUNC startup()
  66. {
  67.  RETURN;
  68. }
  69.